import {request} from "./request";

export function getAllDaily(data) {
  return request({
    url: "/getAllDaily",
    method: "post",
    params: {
      pageNo: data.pageNo,
      pageSize: data.pageSize
    }
  })
}

export function addDaily(data) {
  return request({
    url: "/addDaily",
    method: "post",
    params: {
      account: window.sessionStorage.getItem('account'),
      applicant: window.sessionStorage.getItem('name'),
      other: data.other,
      problem: data.problem,
      tomorrow_plan: data.tomorrow_plan,
      work_content: data.work_content,
      work_process: data.work_process
    }
  })
}

export function delDaily(id) {
  return request({
    url: "/delDaily",
    method: "post",
    params: {
      id: id
    }
  })
}

export function editDaily(data) {
  return request({
    url: "/editDaily",
    method: "post",
    params: {
      account: window.sessionStorage.getItem('account'),
      applicant: window.sessionStorage.getItem('name'),
      other: data.other,
      problem: data.problem,
      tomorrow_plan: data.tomorrow_plan,
      work_content: data.work_content,
      work_process: data.work_process,
      id: data.id
    }
  })
}
export function findByDate(data, page) {
  return request({
    url: "/findByDate",
    method: "post",
    params: {
      startTime: data.startTime,
      endTime: data.endTime,
      pageNo: page.pageNo,
      pageSize: page.pageNo
    }
  })
}
